/**
 * Copyright (c) 2020 Coder League
 * All rights reserved.
 *
 * File：LocalNotifyController.java
 * History:
 *         2020年12月22日: Initially created, Chrise.
 */
package club.coderleague.cfss.controller.local;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import club.coderleague.cfss.controller.NosessionRequestController;
import club.coderleague.cfss.service.interfaces.AliyunInterfaceService;
import club.coderleague.configure.condition.ConditionalOnProperty;

/**
 * 本地通知控制器。
 * @author Chrise
 */
@Controller
@RequestMapping(NosessionRequestController.REQUEST_PREFIX + "/local")
@ConditionalOnProperty(path = "${custom.aliyun.configLocation}", name = "aliyun.localNotify", havingValue = "true")
public class LocalNotifyController {
	@Autowired
	private AliyunInterfaceService aiService;
	
	/**
	 * 查询通知。
	 * @author Chrise 2020年12月22日
	 * @param phone 手机号。
	 * @return 通知内容。
	 */
	@ResponseBody
	@GetMapping("/notify.xhtml")
	public Object notify(String phone) {
		return this.aiService.getLocalNotify(phone);
	}
}
